<%@ page import="com.common.pageBean" %>
<%@ page import="com.common.pcBean" %>
<%--
  Created by IntelliJ IDEA.
  User: ztc
  Date: 16-3-18
  Time: 下午7:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>电脑保修列表</title>
  <link href="css/min.css" rel="stylesheet">
  <link href="css/login.css" rel="stylesheet">
  <script src="js/jquery.js"></script>
  <script src="js/min.js"></script>
</head>
<%
  int curPage=1;
  int pageSize=10;
  if(request.getParameter("curPage")!=null&&request.getParameter("pageSize")!=null) {
    curPage = Integer.parseInt(request.getParameter("curPage"));
    pageSize = Integer.parseInt(request.getParameter("pageSize"));
  }
  pageBean pagebean = new pageBean(curPage, pageSize);

%>
<body>
<center>
  <h1>电脑保修列表</h1>
  <table class="table" width="80%">
    <tr align="center"><td><b>学号</b></td><td><b>姓名</b></td><td><b>描述</b></td><td><b>详情</b></td></tr>
    <%
      boolean st=true;
      String style;
      int i=0;
      for(pcBean p:pagebean.getList()) {
        if(st){
          style="class=\"success\"";
          st=false;
        }else{
          style="";
          st=true;
        }
        out.println("<tr "+style+" align=\"center\">");
        out.println("<td>"+p.getXh()+"</td>");
        out.println("<td>"+p.getName()+"</td>");
        out.println("<td>"+p.getDescrib()+"</td>");
        out.println("<td><a href=\"/pcFixInf.jsp?curPage="+curPage+"&pageSize="+pageSize+"&i="+i+"\">链接</a></td>");
        out.println("</tr>");
        i++;
      }
    %>
  </table>
  <a href="pcFixList.jsp?curPage=<%=pagebean.getPreviousPage()%>&pageSize=<%=pageSize%>">上一页</a>
  <a href="pcFixList.jsp?curPage=<%=pagebean.getNextPage()%>&pageSize=<%=pageSize%>">下一页</a>
  当前<%=pagebean.getCurPage()+1%>/<%=pagebean.getAllPage()%>
  <a href="/pcFix.jsp"><button type="button" id="button" class="btn btn-primary btn-block btn-lg" style="width: 700px">我要报修</button></a>
</center>

</body>
</html>
